#include<stdio.h>
#include "Python.h"
//#include "../scrWatcher/ImageProcess.h"
#include "structmember.h"
#include "../scrWatcher/Watcher.h"
//-ID:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\include -L
// spam.c

static PyObject *SpamError;

static PyObject *
    init(PyObject *self, PyObject *args)
{
    const char *picPath;
    int sts=-1;

	if (!PyArg_ParseTuple(args, "s", &picPath))
        return NULL;

	//init();
    /*if (sts < 0) {
        PyErr_SetString(SpamError, "System command failed");
        return NULL;
    }*/

	return Py_BuildValue("i", 0);
}

static PyTypeObject watcher_module[] = {
	0
};

static PyMethodDef scrwatcher_methods[] = {
    {"init",  init, METH_VARARGS,
    "Execute a shell command."},
    {NULL, NULL, 0, NULL}        /* Sentinel */
};

static PyModuleDef cModPyDem = {
		PyModuleDef_HEAD_INIT,
		"scrwatcher",                        // Module name
		"Provides some functions, but faster",  // Module description
		0,
		scrwatcher_methods                   // Structure that defines the methods
	};



PyMODINIT_FUNC PyInit_scrwatcher(void)
	{
		PyObject *m = PyModule_Create(&cModPyDem);
		if (!m)
			return NULL;

		CScore_ClassInfo.tp_new = PyType_GenericNew;
		
		if (PyType_Ready(&CScore_ClassInfo) < 0)
			goto fail;

		Py_INCREF((PyObject*)&CScore_ClassInfo);
		if (PyModule_AddObject(m, "Watcher", (PyObject*)&CScore_ClassInfo) < 0) {
			Py_DECREF((PyObject*)&CScore_ClassInfo);
			goto fail;
		}

		return m;

	fail:
		Py_DECREF(m);
		return NULL;
	}
